package com.longjianghuasheng.logistics.business.mine.fragment

import android.os.Bundle
import com.longjianghuasheng.logistics.R
import com.longjianghuasheng.logistics.base.BaseTitleFragment
import com.longjianghuasheng.logistics.business.mine.AboutViewModel
import com.longjianghuasheng.logistics.databinding.FragmentPrivacyBinding
import com.longjianghuasheng.logistics.ext.observer
import com.longjianghuasheng.logistics.ext.toHtml
import me.hgj.jetpackmvvm.ext.view.visible

class PrivacyFragment : BaseTitleFragment<AboutViewModel, FragmentPrivacyBinding>() {

    override fun layoutId(): Int = R.layout.fragment_privacy

    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)
        initTitleBar("隐私政策")

    }

    override fun createObserver() {
        super.createObserver()
        mViewModel.result.observer(this) {
            mDatabind.tvContent.text = it.content ?.toHtml()

            mDatabind.clBg.visible()
        }
    }

    override fun initData() {
        super.initData()
        mViewModel.id = 7
    }

    override fun lazyLoadData() {
        super.lazyLoadData()
        mViewModel.abouts()
    }
}
